<?php if(!defined("PATH_HD"))exit;C("SHOW_NOTICE",false);?><!DOCTYPE html>
<html>
    <head>
        <title>HDinfo安装程序</title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <link type="text/css" rel="stylesheet" href="http://localhost/cms/install/tpl/public/css/setconfig.css"/>
</head>
<body>
    <div class="setup">
        <div class="title">
            EasyCMS Install
        </div>
        <div class="copy">
            <p>
                <?php echo $setup['version'];?>
            </p>
        </div>
        <div class="body">
            <h2>环境检测</h2>
            <form action="http://localhost/cms/install/index.php/index/installdb" method="post" name='installdb'>
                <table>
                    <tr>
                        <td style="width:120px;" align='right'>数据库连接主机：</td>
                        <td style="width:320px;"><input type="text" name="db[DB_HOST]" value="localhost"/></td>
                        <td style='color:#B5B5B5'>数据库服务器地址一般为localhost</td>
                    </tr>
                    <tr>
                        <td style="width:120px;" align='right'>数据库用户名：</td>
                        <td style="width:320px;"><input type="text" name="db[DB_USER]" value="root"/></td>
                        <td>&nbsp;</td>
                    </tr>
                    <tr>
                        <td style="width:120px;" align='right'>数据库密码：</td>
                        <td style="width:320px;"><input type="text" name="db[DB_PASSWORD]"/></td>
                        <td>&nbsp;</td>
                    </tr>
                    <tr>
                        <td style="width:120px;" align='right'>数据库名称：</td>
                        <td style="width:320px;"><input type="text" name="db[DB_DATABASE]" value="hdinfo"/></td>
                        <td>&nbsp;</td>
                    </tr>
                    <tr>
                        <td style="width:120px;" align='right'>端口：</td>
                        <td style="width:320px;"><input type="text" name="db[DB_PORT]" value="3306"/></td>
                        <td style='color:#B5B5B5'>一般数据库连接端口为3306</td>
                    </tr>
                    <tr>
                        <td style="width:120px;" align='right'>数据表前缀：</td>
                        <td style="width:320px;"><input type="text" name="db[DB_PREFIX]" value="hd_"/></td>
                        <td>&nbsp;</td>
                    </tr>
                    <tr>
                        <td style="width:120px;" align='right'>数据库驱动：</td>
                        <td style="width:320px;">
                            <input type="radio" name="db[DB_DRIVER]" style="width:20px;" checked="checked"value="mysqli"/>
                            <strong>mysqli</strong></td>
                        <td>&nbsp;</td>
                    </tr>
                </table>
                <!--目录检测-->
                <h2>管理员信息</h2>
                <table style="width:90%">
                    <tr>
                        <td style="width:120px;" align='right'>管理员名称：</td>
                        <td style="width:320px;">
                            <input type="text" name="admin[username]" value="admin"/>
                        </td>
                        <td>&nbsp;</td>
                    </tr>
                    <tr>
                        <td style="width:120px;" align='right'>管理员密码：</td>
                        <td style="width:320px;">
                            <input type="password" name="admin[password]" id='pwd'/>
                        </td>
                        <td style='color:#B5B5B5'>密码不要与管理员名称相同</td>
                    </tr>
                    <tr>
                        <td style="width:120px;" align='right'>重复密码：</td>
                        <td style="width:320px;">
                            <input type="password" name="admin[password2]" id = 'pwded'/>
                        </td>
                        <td style='color:#B5B5B5'>密码不要与管理员名称相同</td>
                    </tr>
                    <tr>
                        <td style="width:120px;" align='right'>管理员邮箱：</td>
                        <td style="width:320px;">
                            <input type="text" name="admin[email]" value="admin@admin.com"/>
                        </td>
                        <td>&nbsp;</td>
                    </tr>
                </table>


        </div>
        <div class="submit">
            <input type='submit' class='submit' value='下一步'/>
        </div>
    </form>
    <div class="step">
    </div>
</div>
<script language-'javascript'>
    document.forms[0].onsubmit = function(){
        if (document.getElementById('pwd').value == '') {
            alert('请填写密码');
            return false;
        };
        if (document.getElementById('pwd').value != document.getElementById('pwded').value) {
            alert('两次密码不一致');
            return false;
        }
    }
</script>
</body>
</html>
